/*
 * @Author: Kiro AI Assistant
 * @Date: 2025-01-10
 * @Description: 音频服务处理器测试
 */

import 'package:flutter_test/flutter_test.dart';
import '../../lib/services/audio_service_handler.dart';

void main() {
  group('AudioServiceHandler Tests', () {
    late AudioServiceHandler audioServiceHandler;

    setUp(() {
      audioServiceHandler = AudioServiceHandler.instance;
    });

    tearDown(() async {
      await audioServiceHandler.dispose();
    });

    test('应该是单例模式', () {
      final instance1 = AudioServiceHandler.instance;
      final instance2 = AudioServiceHandler.instance;
      expect(instance1, same(instance2));
    });

    test('应该正确创建实例', () {
      expect(audioServiceHandler, isNotNull);
      expect(audioServiceHandler, isA<AudioServiceHandler>());
    });

    test('dispose 应该正常执行', () async {
      expect(() => audioServiceHandler.dispose(), returnsNormally);
    });

    test('updateLockscreenInfo 应该正常执行', () {
      expect(() => audioServiceHandler.updateLockscreenInfo(), returnsNormally);
    });
  });
}
